package com.supaur.demo.mybatis.enums;

/**
 * @author huangj
 * @date 2019/10/9
 */
public enum ArticleTypeEnum {

    JAVA(1),
    DUBBO(2),
    SPRING(4),
    MYBATIS(8);

    private int code;

    ArticleTypeEnum(int code) {
        this.code = code;
    }

    public int getCode() {
        return this.code;
    }

    public static ArticleTypeEnum find(int code) {
        for (ArticleTypeEnum at : ArticleTypeEnum.values()) {
            if (at.getCode() == code) {
                return at;
            }
        }
        return null;
    }

}